import React from 'react';
import Bread from '../../component/TableContent/VipBread';
import axios from '../../utils/http'
import { Button, message } from 'antd'
//结算详情
class SetDetails extends React.Component {
  constructor() {
    super()
    this.state = {
      alldata: {
      },
    }
  }
  
  componentDidMount() {
    axios({
      url: '/member/querySetMgtDetailsForMsg',
      method: 'get',
      params:{setmgt_id:2}
    }).then(data => {
      console.log(data.data)
      this.setState({
        alldata:data.data.data
      })
    })
  }
  yicome = () => {
    let alldata = this.state.alldata
    alldata.setmgtStatus=1
    this.setState({
      alldata
    }, () => {
      message.success('审核成功')
    }
    )
  }
  weicome = () => {
    let alldata = this.state.alldata
    alldata.setmgtStatus=2
    this.setState({
      alldata
    }, () => {
      message.success('审核成功')
    }
    )
  }
  render() {
      return (
        <div>
          <Bread mianbao='结算详细'></Bread>
          <div className='wrapper'>
            基本信息
            <hr />
            结算编号：{this.state.alldata.setmgtSbcn }<br/>
            结算状态：{this.state.alldata.setmgtStatus === 0 ? '未审核' : this.state.alldata.setmgtStatus === 1 ? '已审核，已通过':'已审核，未通过'}<br />
            申请合伙人：{ this.state.alldata.setmgtAp} <br />
            结算金额：{this.state.alldata.setmgtSa } <br />
            结算银行账号：{this.state.alldata?.cmtpts?.cmtptsBcan === null ? '未知':this.state.alldata?.cmtpts?.cmtptsBcan} <br />
            申请时间：{this.state.alldata?.cmtpts?.cmtptsAt === null  ? '未知':this.state.alldata?.cmtpts?.cmtptsAt }
            <hr />
            客户留言：{ this.state.alldata.setmgtCm}
            <hr />
            社区合伙人信息
            <hr />
            姓名：{this.state.alldata?.cmtpts?.cmtptsName } <br/>
            手机：{this.state.alldata?.cmtpts?.cmtptsPhone} <br/>
            小区名称：{this.state.alldata?.cmtpts?.cmtptsCmtname} <br/>
            小区地址：{ this.state.alldata?.cmtpts?.cmtptsCmtars} <br/>
            身份证号：{ this.state.alldata?.cmtpts?.cmtptsCmtsca} <br />
            <hr />
            <div>
              可执行操作：<Button className='surename' onClick={this.yicome}> 已到账 </Button ><Button className='surename' onClick={this.weicome}> 未到账</Button>
            </div>
          </div>
        </div>
      );
    }
}
export default SetDetails;